//
//  PassPositionVerifyView.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/21.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class PassPositionVerifyView: UIView {
    lazy var headerImg : UIImageView = {
        let value = UIImageView(image: UIImage(named: "icon_header"))
        return value
    }()
    
    lazy var nameLable : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 85, g: 85, b: 85, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(22)))
        value.text = "六神"
        return value
    }()
    lazy var vipImg : UIImageView = {
        let value = UIImageView(image: UIImage(named: "icon_vip"))
        return value
    }()
    lazy var phoneLable : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 85, g: 85, b: 85, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(13)))
        value.text = "13614597056"
        return value
    }()
    lazy var houseLable : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 185, g: 160, b: 130, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(22)))
        value.text = "建宁花园小区"
        return value
    }()
    lazy var cardTypeLable : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 185, g: 185, b: 185, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(15)))
        value.text = "业主服务卡"
        return value
    }()
    lazy var qrImg : UIImageView = {
        let value = UIImageView()
        return value
    }()
    lazy var qrNoLabel : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 185, g: 185, b: 185, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(15)))
        value.text = "343434343"
        return value
    }()
    lazy var stateLabel : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 40, g: 40, b: 40, a: 1), textFont: UIFont.boldSystemFont(ofSize: Adapter(15)))
        value.text = "已经通过房屋身份核验!"
        return value
    }()
    lazy var gouImg : UIImageView = {
        let value = UIImageView(image: UIImage(named: "icon_success"))
        return value
    }()
    
    
    required init?(coder: NSCoder) {
        super .init(coder: coder)
    }
    override init(frame: CGRect) {
        super .init(frame: frame)
        setUI()
    }
    func setUI() {
        
        self.addSubview(headerImg)
        headerImg.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.centerY.equalTo(self.snp.top)
            make.size.equalTo(CGSize(width: Adapter(50), height: Adapter(50)))
        }
        self.addSubview(nameLable)
        nameLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(headerImg.snp.bottom).offset(Adapter(8))
            make.height.equalTo(Adapter(30))
        }
        self.addSubview(vipImg)
        vipImg.snp.makeConstraints { (make) in
            make.left.equalTo(nameLable.snp.right).offset(Adapter(Adapter(5)))
            make.bottom.equalTo(nameLable).offset(Adapter(-5))
            make.size.equalTo(CGSize(width: Adapter(21), height: Adapter(14)))
        }
        self.addSubview(phoneLable)
        phoneLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(nameLable.snp.bottom).offset(Adapter(8))
            make.height.equalTo(Adapter(15))
        }
        
        let lineTop = UIView()
        lineTop.backgroundColor = RGBColor(r: 140, g: 140, b: 140, a: 1);
        self.addSubview(lineTop)
        lineTop.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.top.equalTo(phoneLable.snp.bottom).offset(Adapter(15))
            make.height.equalTo(Adapter(0.8))
        }
        
        self.addSubview(houseLable)
        houseLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(lineTop.snp.bottom).offset(Adapter(15))
            make.height.equalTo(Adapter(25))
        }
        
        self.addSubview(cardTypeLable)
        cardTypeLable.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(houseLable.snp.bottom).offset(Adapter(8))
            make.height.equalTo(Adapter(16))
        }
        qrImg.image = UIImage.cwQRCodeImage(content: "333333333")
        self.addSubview(qrImg)
        qrImg.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(cardTypeLable.snp.bottom).offset(Adapter(20))
            make.size.equalTo(CGSize(width: ScreenWidth - Adapter(30) - Adapter(130), height:  ScreenWidth - Adapter(30) - Adapter(130)))
        }
        
        self.addSubview(qrNoLabel)
        qrNoLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(qrImg.snp.bottom).offset(Adapter(15))
            make.height.equalTo(Adapter(16))
        }
        
        
        self.addSubview(qrNoLabel)
        qrNoLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg)
            make.top.equalTo(qrImg.snp.bottom).offset(Adapter(20))
            make.height.equalTo(Adapter(16))
        }
        
        let lineBottom = UIView()
        lineBottom.backgroundColor = RGBColor(r: 140, g: 140, b: 140, a: 1);
        self.addSubview(lineBottom)
        lineBottom.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.bottom.equalToSuperview().offset(-Adapter(100))
            make.height.equalTo(Adapter(0.8))
        }
        
        self.addSubview(stateLabel)
        stateLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(headerImg).offset(10)
            make.top.equalTo(lineBottom.snp.bottom).offset(Adapter(45))
            make.height.equalTo(Adapter(16))
        }
        
        self.addSubview(gouImg)
        gouImg.snp.makeConstraints { (make) in
            make.centerY.equalTo(stateLabel)
            make.right.equalTo(stateLabel.snp.left).offset(-10)
            make.size.equalTo(CGSize(width: Adapter(15), height:  Adapter(15)))
        }
    }
}
